#ifndef CONTROLLER_H
#define CONTROLLER_H
#include <string>
#include <stdio.h>
#include <iostream>
#include <fstream>
#include <ctype.h>
#include <vector>
#include <stack>
#include "Storage.h"
#include "Messages.h"
#include "Parser.h"
using namespace std;

class Controller{
public:
	Parser P;
	enum CommandType {ADD, DISPLAY, DELETE, MODIFY, EXIT,SEARCH,SORT,INVALID};
	Controller();
	Controller(string outPutFile);
	string getUserCommandLine();
	CommandType getUserCommand();
	string executeUserCommand();
	void showToUser(string);
	void welcome();
	string sort();
	void display(vector<Task*>);
	string search(string);
	string addTask(string);
	string deleteTask(int);
	string displayFile();
	string clearFile();
	string modify();
	
private:
	 string word;
	 string outputFile;
	 string strOnOperation ;
	 string commandLine;
	 vector<string> searchResult;
	 CommandType commandNow;
	 Storage container;
	 Messages Mes;
	 stack<Task*> undos;
};
#endif